#ifndef BULLET_STATE_H
#define BULLET_STATE_H

#include "Engine.h"
#include <btBulletDynamicsCommon.h>

/*
This State provides a Bullet world.
http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World

TODO: abstract this state
*/

class BulletState : public State
{
public: // State implementation
	virtual ~BulletState() {}

	virtual void init( Engine* game );
	virtual void cleanup( Engine* game );

	virtual void input( Engine* game );
	virtual void update( Engine* game );
	virtual void draw( Engine* game );

	virtual void setCaption( std::ostringstream& buffer );

public: // Singleton pattern
	static State* Instance();
protected:
	BulletState();

public: // Functions

private: // Functions

private: // Members
	int frames_elapsed;

	// Bullet
	btBroadphaseInterface* broadphase;
	btDefaultCollisionConfiguration* collisionConfiguration;
	btCollisionDispatcher* dispatcher;
	btSequentialImpulseConstraintSolver* solver;
	btDiscreteDynamicsWorld* dynamicsWorld;
};

#endif

